
<?php

	$columns = array();
	$columns[] = "pk_nr";
	$columns[] = "name";
	$result = $db->select("projekt", $columns);	
	
	echo "<p><a href='create_projects.php'>Neues Projekt anlegen</a></p>";
	echo "<table border='1'>";
	echo "<tr>";
		echo "<td> Projektnummer </td>";
		echo "<td> Name </td>";
	
	foreach($result as $entry) {
		echo '<tr>';
		echo '<td>' . $entry['pk_nr'] . '</td>' . '<td>' . '<a href="../Projekte/show_project.php?id=' . $entry['pk_nr'] . '">' . $entry['name'] . '</a></td>' . '<td>' . '<a href="../Projekte/alter_project.php?id=' . $entry['pk_nr'] . '"> Bearbeiten' . '</a>';
		echo '</tr>';
	}
	echo "</table>";


?>
<form action="<?php  echo $_SERVER['PHP_SELF']; ?>" name="check" method="post">
  <p>
    <input type="checkbox" name="projects_ood" value="true" onclick="document.check.submit()"> Abgelaufene Projekte anzeigen
  </p>
</form>